// src/logical/user/user.dto.ts
import { IsNotEmpty, IsNumber, IsString } from 'class-validator'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class RegisterInfoDTO {
    @ApiProperty()
    @IsNotEmpty({ message: '用户名不能为空' })
    @IsString({ message: '真实姓名必须是 String 类型' })
    readonly user_name: string
    // @ApiProperty()
    // @IsNotEmpty({ message: '真实姓名不能为空' })
    // @IsString({ message: '真实姓名必须是 String 类型' })
    // readonly realName: string
    @ApiProperty()
    @IsNotEmpty({ message: '密码不能为空' })
    readonly password: string
    @ApiProperty()
    @IsNotEmpty({ message: '重复密码不能为空' })
    readonly repassword: string
    @ApiProperty()
    @IsNotEmpty({ message: '手机号不能为空' })
    @IsString()
    readonly mobile: string
    // @ApiProperty({
    //     required: false,
    //     description:
    //         '[用户角色]: 0-超级管理员 | 1-管理员 | 2-开发&测试&运营 | 3-普通用户（只能查看）'
    // })
    @ApiPropertyOptional({
        description:
            '[用户角色]: 0-超级管理员 | 1-管理员 | 2-开发&测试&运营 | 3-普通用户（只能查看）'
    })
    readonly role?: string | number
}
export class RegisterDTO {
    @ApiProperty({ description: '用户名', example: 'js' })
    @IsNotEmpty({ message: '用户名不能为空' })
    readonly user_name: string
    // @ApiProperty({ description: '昵称', example: 'js' })
    // @IsNotEmpty({ message: '昵称不能为空' })
    // readonly realName: string
    @ApiProperty({ description: '密码', example: '123' })
    @IsNotEmpty({ message: '密码不能为空' })
    readonly password: string
    @ApiProperty({ description: '确认密码', example: '123' })
    @IsNotEmpty({ message: '确认密码不能为空' })
    readonly repassword: string
    @ApiProperty({ description: '手机号', example: '18792883310' })
    @IsNotEmpty({ message: '手机号不能为空' })
    readonly mobile: string
}

export class LoginDTO {
    @ApiProperty({ description: '用户名', example: 'js' })
    @IsNotEmpty({ message: '用户名不能为空' })
    readonly username: string
    @ApiProperty({ description: '密码', example: '123' })
    @IsNotEmpty({ message: '密码不能为空' })
    readonly password: string
}
